﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ClassLibrary.Data;
using System.Data;
using ClassLibrary.Entitty;

namespace ClassLibrary.DAO
{
    public class TblMenuDAO
    {
        
        private DBService _db = null;
        public TblMenuDAO(String ConnectionString)
        {
            _db = new DBService(ConnectionString);
        }

        public DataTable Menu_Insert(TblMenu menu, int mode)
        {
            DataTable dt = null;
            try
            {
                dt = _db.ExeSP_DataTable("sp_TblMenu_InsUp",
                    new string[] { "@IDMenu", "@MenuName", "@Description" },
                    new object[] { menu.IDMenu, menu.MenuName, menu.Description }, CommandType.StoredProcedure);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return dt;
        }
    }
}
